package net.lab1024.sa.admin.module.business.quotation.dao;

import java.util.List;
import net.lab1024.sa.admin.module.business.quotation.domain.entity.QuotationEntity;
import net.lab1024.sa.admin.module.business.quotation.domain.form.QuotationItemsQueryForm;
import net.lab1024.sa.admin.module.business.quotation.domain.form.QuotationQueryForm;
import net.lab1024.sa.admin.module.business.quotation.domain.vo.QuotationItemsVO;
import net.lab1024.sa.admin.module.business.quotation.domain.vo.QuotationVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 报价信息 Dao
 *
 * @Author zzx
 * @Date 2025-08-07 19:37:04
 * @Copyright zzx
 */

@Mapper
public interface QuotationDao extends BaseMapper<QuotationEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<QuotationVO> queryPage(Page page, @Param("queryForm") QuotationQueryForm queryForm);


    /**
     * 更新删除状态
     */
    long updateDeleted(@Param("quotationId")Long quotationId,@Param("deletedFlag")boolean deletedFlag);

    /**
     * 批量更新删除状态
     */
    void batchUpdateDeleted(@Param("idList")List<Long> idList,@Param("deletedFlag")boolean deletedFlag);

    /**
     * 通过报价id获取报价明细
     *
     * @return
     */
    List<QuotationItemsVO> queryItemsById(@Param("quotationId") Long quotationId);

    /**
     * 通过报价id获取报价明细
     *
     * @return
     */
    List<QuotationItemsVO> queryItemsPage(Page page, @Param("queryForm") QuotationItemsQueryForm queryForm);
}
